import 'package:flutter/material.dart';
import 'package:flutter_module/common/extensions/cached_network_image_extension.dart';
import 'package:flutter_module/model/cooperation_list_mo.dart';
import 'package:flutter_module/style/colors.dart';

class CooperationLisRow extends StatelessWidget {
  const CooperationLisRow({Key? key, required this.item}) : super(key: key);

  final CooperationListItemMo item;

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.fromLTRB(16, 10, 16, 0),
      padding: EdgeInsets.fromLTRB(13, 15, 13, 13),
      width: double.infinity,
      color: Colors.white,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          Container(
            width: 70,
            height: 70,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(12),
              border: Border.all(color: Colors.grey.shade300, width: 1),
            ),
            clipBehavior: Clip.hardEdge,
            child: YFNetworkImage(resource: item.companyLogoUrl),
          ),
          SizedBox(width: 12),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  item.companyName ?? '',
                  // maxLines: 1,
                  textWidthBasis: TextWidthBasis.parent,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(
                      fontSize: 16,
                      color: ThemeColors.text333,
                      fontWeight: FontWeight.bold),
                ),
                SizedBox(height: 4),
                Text(
                  item.targetCodeName ?? '',
                  maxLines: 1,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(
                    fontSize: 12,
                    color: ThemeColors.text888,
                  ),
                ),
                SizedBox(height: 6),
                Container(
                  height: 18,
                  padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
                  decoration: BoxDecoration(
                      color: ThemeColors.grayF3F3F3,
                      borderRadius: BorderRadius.all(Radius.circular(18.0))),
                  child: Text(
                    item.provinceName ?? '',
                    style: TextStyle(
                      color: ThemeColors.text333,
                      fontSize: 10,
                    ),
                  ),
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}
